package com.primary.service;

import com.github.pagehelper.PageInfo;
import com.primary.controller.dto.ChangePasswordDto;
import com.primary.controller.request.UsersRequest;
import com.primary.entity.Users;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service("UsersService")
public interface UsersService {

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    Users getUserByNameAndPassword(String name,String password);

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    List<Users> allusers();

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    int registerByNameAndPwd(Users users);

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    Users getNameForRegister(String name);

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    int insertOneUser(Users users);

    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    int updateOneUserById(Users users);
    /**
     * @author Shen Jianhui
     * @date 2023/07/16 Sunday
     */
    boolean deleteUserById(Integer id);

    /**
     * @author Shen Jianhui
     * @date 2023/07/18 Tuesday
     */
    PageInfo<Map<String, Object>> queryByPage(UsersRequest usersRequest);

    /**
     * @author Shen Jianhui
     * @date 2023/10/22 Sunday
     */
    int changePassword(ChangePasswordDto users);
}
